Easy C++ Programming Guide: Step-By-Step Guide To Learn C++ Programming With Hands-On Project by Matthew Robert

Easy C++ Programming Guide: Step-By-Step Guide To Learn C++ Programming With Hands-On Project by Matthew Robert

Author:Matthew, Robert [Matthew, Robert]
Language: eng
Format: epub
Published: 2021-07-09T00:00:00+00:00


13 soup();

14

15 return(0);

16 }

17

18

Above the primary function is the sup function. That's fine since the compiler still recognizes them in a function, and the first function in the program is always performed. The prototype for the sup function lacks here. Make a copy of the code and execute it.

As you can see, the code produces the expected text. But consider this: After the main function, place the sup function as follows:

1 #include <stdio.h>

2

3

4 {

5 puts(“Pea green soup!”);

6 }

7

8 int main()

9 void soup(void);

10 {

11 printf (“For breakfast I had “);

12 soup();

13 printf(“For lunch I had “);

14 soup();

15

16 return(0);

17 }

18

19

Save and construct the code. One warning will appear on most machines. Your compiler may choose to report the wrongdoings differently. It's not good in any case. You must include the prototype. Move the void soup(void) function above the primary function.

1 #include <stdio.h>

2

3

4 {

5 puts(“Pea green soup!”);

6 }

7

8 void soup(void);



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.